home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Micro Mail / MicroMail.jar / MicroMail.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-09-14  |  3.0 KB  |  114 lines

  1. import javax.microedition.lcdui.Display;
  2. import javax.microedition.midlet.MIDlet;
  3.  
  4. public class MicroMail extends MIDlet {
  5.    public static Display display;
  6.    private static boolean appShutdown = false;
  7.    private static boolean endConnection = false;
  8.    public static MainScreen mainScreen;
  9.    // $FF: renamed from: r Resource
  10.    public static Resource field_0;
  11.    private static int delayTime = 3000;
  12.  
  13.    public MicroMail() {
  14.       display = Display.getDisplay(this);
  15.    }
  16.  
  17.    protected void destroyApp(boolean var1) {
  18.       appShutdown = true;
  19.    }
  20.  
  21.    public static void dispose(Object var0) {
  22.       var0 = null;
  23.       System.gc();
  24.    }
  25.  
  26.    public static boolean getAppShutdown() {
  27.       return appShutdown;
  28.    }
  29.  
  30.    public static boolean getEndConnection() {
  31.       return endConnection;
  32.    }
  33.  
  34.    public static void loadResource() {
  35.       String var0 = System.getProperty("microedition.locale");
  36.  
  37.       try {
  38.          if (var0 == null) {
  39.             field_0 = (Resource)Class.forName("ResourceEn").newInstance();
  40.          } else if (!var0.equals("en") && !var0.equals("en-us")) {
  41.             if (var0.equals("de")) {
  42.                field_0 = (Resource)Class.forName("ResourceDe").newInstance();
  43.             } else if (var0.equals("es")) {
  44.                field_0 = (Resource)Class.forName("ResourceEs").newInstance();
  45.             } else if (var0.equals("fr")) {
  46.                field_0 = (Resource)Class.forName("ResourceFr").newInstance();
  47.             } else if (var0.equals("it")) {
  48.                field_0 = (Resource)Class.forName("ResourceIt").newInstance();
  49.             } else {
  50.                field_0 = (Resource)Class.forName("ResourceEn").newInstance();
  51.             }
  52.          } else {
  53.             field_0 = (Resource)Class.forName("ResourceEn").newInstance();
  54.          }
  55.       } catch (Exception var1) {
  56.       }
  57.  
  58.    }
  59.  
  60.    protected void pauseApp() {
  61.    }
  62.  
  63.    public static void printInfo(String var0) {
  64.       System.out.println(var0);
  65.    }
  66.  
  67.    public static void setEndConnection(boolean var0) {
  68.       endConnection = var0;
  69.    }
  70.  
  71.    protected void startApp() {
  72.       loadResource();
  73.       if (AccountHandler.getCount() == 0) {
  74.          Address var1 = new Address();
  75.          var1.email = "sl45i@gmx.net";
  76.          var1.name = "Demo";
  77.          var1.ID = -1;
  78.          MicroCache.storeAddress(var1, -1);
  79.          Account var2 = new Account();
  80.          var2.ID = -1;
  81.          var2.accountName = "Demo";
  82.          var2.popHost = "pop.gmx.net";
  83.          var2.popPort = 110;
  84.          var2.smtpHost = "mail.gmx.net";
  85.          var2.smtpPort = 25;
  86.          var2.username = "sl45i@gmx.net";
  87.          var2.password = "siemens";
  88.          var2.accountActive = true;
  89.          var2.downloadMail = false;
  90.          var2.emailName = "Sl45i";
  91.          var2.emailAddress = "sl45i@gmx.net";
  92.          var2.replyAddress = "sl45i@gmx.net";
  93.          AccountHandler.storeAccount(var2, (String)null);
  94.          Object var6 = null;
  95.       }
  96.  
  97.       mainScreen = new MainScreen(this);
  98.       display.setCurrent(mainScreen);
  99.       long var4 = System.currentTimeMillis();
  100.       AccountHandler.repairIDsFiles();
  101.       System.gc();
  102.       var4 = System.currentTimeMillis() - var4;
  103.       if (var4 < (long)delayTime) {
  104.          try {
  105.             Thread.sleep((long)delayTime - var4);
  106.          } catch (Exception var3) {
  107.          }
  108.       }
  109.  
  110.       mainScreen.setShowIntroScreen(false);
  111.       System.gc();
  112.    }
  113. }
  114.